projects
/
project
/
bcm63xx
/
u-boot.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
72a38e0
)
cros_ec: Reinit the cros_ec device when 'crosec init' is used
author
Simon Glass
<
[email protected]
>
Thu, 26 Mar 2015 15:29:31 +0000
(09:29 -0600)
committer
Simon Glass
<
[email protected]
>
Sat, 18 Apr 2015 17:11:15 +0000
(11:11 -0600)
This command is supposed to reinit the device. At present with driver
model is does nothing. Implement this feature.
Signed-off-by: Simon Glass <
[email protected]
>
drivers/misc/cros_ec.c
patch
|
blob
|
history
diff --git
a/drivers/misc/cros_ec.c
b/drivers/misc/cros_ec.c
index efcad89eb0bb9c2ebe2eb464f5f6a5c06174fa19..6d4d04561cbf9c2cc9b791794aa0f65476fe2548 100644
(file)
--- a/
drivers/misc/cros_ec.c
+++ b/
drivers/misc/cros_ec.c
@@
-1606,13
+1606,19
@@
static int do_cros_ec(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
cmd = argv[1];
if (0 == strcmp("init", cmd)) {
-#ifndef CONFIG_DM_CROS_EC
+#ifdef CONFIG_DM_CROS_EC
+ /* Remove any existing device */
+ ret = uclass_find_device(UCLASS_CROS_EC, 0, &udev);
+ if (!ret)
+ device_remove(udev);
+ ret = uclass_get_device(UCLASS_CROS_EC, 0, &udev);
+#else
ret = cros_ec_init(gd->fdt_blob, &dev);
+#endif
if (ret) {
printf("Could not init cros_ec device (err %d)\n", ret);
return 1;
}
-#endif
return 0;
}